package cate.game.play.skill.passive.talent;

import cate.common.util.XT;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 回合开始时，有70%概率清除自身所有负面状态
 */
public class 自律PH extends PassiveHandler {

	private int 概率;

	//概率=7000
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		概率 = args.getInt("概率", 0);
	}

	@Override
	public void onRoundBegin(ActionCtx action) {
		if(XT.chance(概率)){
			skill.owner.buff.tryDispelBad(action);
		}
	}
}
